home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Addition / card_5832.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  11.4 KB  |  507 lines

  1. -- card: 5832 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 5081
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 8003
  11. -- rect: left=354 top=102 right=139 bottom=468
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Next Problem
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if field "Flag" = 0 then exit mouseUp
  23.   show button "Smiley"
  24.   show button "Frowney"
  25.   put empty into field "Comment"
  26.   put "  " into field "Addend1"
  27.   put "  " into field "Addend2"
  28.   put empty into field "Sum"
  29.   if field "Attempts" = second word of bkgnd field "Options" then
  30.     put field "Attempts" into attempts
  31.     put field "Correct" into correct
  32.     put field "Percent" into percent
  33.     put field "Name" into name
  34.     put third word of field "Options" into skill
  35.     put "O" into field "Attempts"
  36.     put "O" into field "Correct"
  37.     put "O" into field "Percent"
  38.     set the lockScreen to true
  39.     set the cursor to 4
  40.     go to first card of bkgnd "Users"
  41.     rotateData
  42.     put name into line 1 of field "name"
  43.     put the date into line 1 of field "Date"
  44.     put skill into line 1 of field "Skill"
  45.     put attempts into line 1 of field "Attempts"
  46.     put correct into line 1 of field "Correct"
  47.     put percent into line 1 of field "Percent"
  48.     pop card
  49.     exit mouseUp
  50.   end if
  51.   get the random of 90
  52.   add 9 to it
  53.   put it into field "Addend1"
  54.   -- get the random of 90
  55.   -- add 9 to it
  56.   -- put it into field "Addend2"
  57.   put 9 into it
  58.   subtract second char of field "Addend1" from it
  59.   get the random of it
  60.   subtract 1 from it
  61.   put it into second char of field "Addend2"
  62.   put 10 into it
  63.   subtract first char of field "Addend1" from it
  64.   put it into lowerBound
  65.   if lowerBound < 9 then
  66.     repeat until it > lowerBound
  67.       get the random of 9
  68.     end repeat
  69.   end if
  70.   put it into first char of field "Addend2"
  71.   put field "Addend1" into answer
  72.   add field "Addend2" to answer
  73.   put "   " into field "Sum"
  74.   put "0" into field "Flag"
  75.   put "?" into char 3 of field "Sum"
  76. end mouseUp
  77.  
  78. on rotateData
  79.   repeat with x = 11 down to 1
  80.     if line x of field "Name" is empty then next repeat
  81.     put x into nextLine
  82.     add 1 to nextLine
  83.     get line x of field "Name"
  84.     put it into line nextLine of field "Name"
  85.     get line x of field "Date"
  86.     put it into line nextLine of field "Date"
  87.     get line x of field "Skill"
  88.     put it into line nextLine of field "Skill"
  89.     get line x of field "Attempts"
  90.     put it into line nextLine of field "Attempts"
  91.     get line x of field "Correct"
  92.     put it into line nextLine of field "Correct"
  93.     get line x of field "Percent"
  94.     put it into line nextLine of field "Percent"
  95.   end repeat
  96. end rotateData
  97.  
  98.  
  99.  
  100.  
  101. -- part 2 (button)
  102. -- low flags: 00
  103. -- high flags: 8003
  104. -- rect: left=355 top=161 right=194 bottom=388
  105. -- title width / last selected line: 0
  106. -- icon id / first selected line: 0 / 0
  107. -- text alignment: 1
  108. -- font id: 0
  109. -- text size: 12
  110. -- style flags: 0
  111. -- line height: 16
  112. -- part name: 7
  113. ----- HyperTalk script -----
  114. on mouseUp
  115.   repeat with x=3 down to 1
  116.     if char x of field "Sum" is "?" then
  117.       put "7" into char x of field "Sum"
  118.       put x into it
  119.       subtract 1 from it
  120.       if  x>1 then put "?" into char it of field "Sum"
  121.       exit mouseUp
  122.     end if
  123.   end repeat
  124. end mouseUp
  125.  
  126.  
  127.  
  128. -- part 3 (button)
  129. -- low flags: 00
  130. -- high flags: 8003
  131. -- rect: left=395 top=161 right=194 bottom=427
  132. -- title width / last selected line: 0
  133. -- icon id / first selected line: 0 / 0
  134. -- text alignment: 1
  135. -- font id: 0
  136. -- text size: 12
  137. -- style flags: 0
  138. -- line height: 16
  139. -- part name: 8
  140. ----- HyperTalk script -----
  141. on mouseUp
  142.   repeat with x=3 down to 1
  143.     if char x of field "Sum" is "?" then
  144.       put "8" into char x of field "Sum"
  145.       put x into it
  146.       subtract 1 from it
  147.       if  x>1 then put "?" into char it of field "Sum"
  148.       exit mouseUp
  149.     end if
  150.   end repeat
  151. end mouseUp
  152.  
  153.  
  154.  
  155. -- part 4 (button)
  156. -- low flags: 00
  157. -- high flags: 8003
  158. -- rect: left=435 top=162 right=194 bottom=467
  159. -- title width / last selected line: 0
  160. -- icon id / first selected line: 0 / 0
  161. -- text alignment: 1
  162. -- font id: 0
  163. -- text size: 12
  164. -- style flags: 0
  165. -- line height: 16
  166. -- part name: 9
  167. ----- HyperTalk script -----
  168. on mouseUp
  169.   repeat with x=3 down to 1
  170.     if char x of field "Sum" is "?" then
  171.       put "9" into char x of field "Sum"
  172.       put x into it
  173.       subtract 1 from it
  174.       if  x>1 then put "?" into char it of field "Sum"
  175.       exit mouseUp
  176.     end if
  177.   end repeat
  178. end mouseUp
  179.  
  180.  
  181.  
  182. -- part 5 (button)
  183. -- low flags: 00
  184. -- high flags: 8003
  185. -- rect: left=356 top=201 right=233 bottom=389
  186. -- title width / last selected line: 0
  187. -- icon id / first selected line: 0 / 0
  188. -- text alignment: 1
  189. -- font id: 0
  190. -- text size: 12
  191. -- style flags: 0
  192. -- line height: 16
  193. -- part name: 4
  194. ----- HyperTalk script -----
  195. on mouseUp
  196.   repeat with x=3 down to 1
  197.     if char x of field "Sum" is "?" then
  198.       put "4" into char x of field "Sum"
  199.       put x into it
  200.       subtract 1 from it
  201.       if  x>1 then put "?" into char it of field "Sum"
  202.       exit mouseUp
  203.     end if
  204.   end repeat
  205. end mouseUp
  206.  
  207.  
  208.  
  209. -- part 6 (button)
  210. -- low flags: 00
  211. -- high flags: 8003
  212. -- rect: left=395 top=202 right=234 bottom=428
  213. -- title width / last selected line: 0
  214. -- icon id / first selected line: 0 / 0
  215. -- text alignment: 1
  216. -- font id: 0
  217. -- text size: 12
  218. -- style flags: 0
  219. -- line height: 16
  220. -- part name: 5
  221. ----- HyperTalk script -----
  222. on mouseUp
  223.   repeat with x=3 down to 1
  224.     if char x of field "Sum" is "?" then
  225.       put "5" into char x of field "Sum"
  226.       put x into it
  227.       subtract 1 from it
  228.       if  x>1 then put "?" into char it of field "Sum"
  229.       exit mouseUp
  230.     end if
  231.   end repeat
  232. end mouseUp
  233.  
  234.  
  235.  
  236. -- part 7 (button)
  237. -- low flags: 00
  238. -- high flags: 8003
  239. -- rect: left=435 top=201 right=233 bottom=466
  240. -- title width / last selected line: 0
  241. -- icon id / first selected line: 0 / 0
  242. -- text alignment: 1
  243. -- font id: 0
  244. -- text size: 12
  245. -- style flags: 0
  246. -- line height: 16
  247. -- part name: 6
  248. ----- HyperTalk script -----
  249. on mouseUp
  250.   repeat with x=3 down to 1
  251.     if char x of field "Sum" is "?" then
  252.       put "6" into char x of field "Sum"
  253.       put x into it
  254.       subtract 1 from it
  255.       if  x>1 then put "?" into char it of field "Sum"
  256.       exit mouseUp
  257.     end if
  258.   end repeat
  259. end mouseUp
  260.  
  261.  
  262.  
  263. -- part 8 (button)
  264. -- low flags: 00
  265. -- high flags: 8003
  266. -- rect: left=356 top=242 right=274 bottom=389
  267. -- title width / last selected line: 0
  268. -- icon id / first selected line: 0 / 0
  269. -- text alignment: 1
  270. -- font id: 0
  271. -- text size: 12
  272. -- style flags: 0
  273. -- line height: 16
  274. -- part name: 1
  275. ----- HyperTalk script -----
  276. on mouseUp
  277.   repeat with x=3 down to 1
  278.     if char x of field "Sum" is "?" then
  279.       put "1" into char x of field "Sum"
  280.       put x into it
  281.       subtract 1 from it
  282.       if  x>1 then put "?" into char it of field "Sum"
  283.       exit mouseUp
  284.     end if
  285.   end repeat
  286. end mouseUp
  287.  
  288.  
  289.  
  290. -- part 9 (button)
  291. -- low flags: 00
  292. -- high flags: 8003
  293. -- rect: left=395 top=241 right=273 bottom=428
  294. -- title width / last selected line: 0
  295. -- icon id / first selected line: 0 / 0
  296. -- text alignment: 1
  297. -- font id: 0
  298. -- text size: 12
  299. -- style flags: 0
  300. -- line height: 16
  301. -- part name: 2
  302. ----- HyperTalk script -----
  303. on mouseUp
  304.   repeat with x=3 down to 1
  305.     if char x of field "Sum" is "?" then
  306.       put "2" into char x of field "Sum"
  307.       put x into it
  308.       subtract 1 from it
  309.       if  x>1 then put "?" into char it of field "Sum"
  310.       exit mouseUp
  311.     end if
  312.   end repeat
  313. end mouseUp
  314.  
  315.  
  316.  
  317. -- part 10 (button)
  318. -- low flags: 00
  319. -- high flags: 8003
  320. -- rect: left=436 top=242 right=274 bottom=468
  321. -- title width / last selected line: 0
  322. -- icon id / first selected line: 0 / 0
  323. -- text alignment: 1
  324. -- font id: 0
  325. -- text size: 12
  326. -- style flags: 0
  327. -- line height: 16
  328. -- part name: 3
  329. ----- HyperTalk script -----
  330. on mouseUp
  331.   repeat with x=3 down to 1
  332.     if char x of field "Sum" is "?" then
  333.       put "3" into char x of field "Sum"
  334.       put x into it
  335.       subtract 1 from it
  336.       if  x>1 then put "?" into char it of field "Sum"
  337.       exit mouseUp
  338.     end if
  339.   end repeat
  340. end mouseUp
  341.  
  342.  
  343.  
  344. -- part 11 (button)
  345. -- low flags: 00
  346. -- high flags: 8003
  347. -- rect: left=355 top=281 right=313 bottom=407
  348. -- title width / last selected line: 0
  349. -- icon id / first selected line: 0 / 0
  350. -- text alignment: 1
  351. -- font id: 0
  352. -- text size: 12
  353. -- style flags: 0
  354. -- line height: 16
  355. -- part name: 0
  356. ----- HyperTalk script -----
  357. on mouseUp
  358.   repeat with x=3 down to 1
  359.     if char x of field "Sum" is "?" then
  360.       put "0" into char x of field "Sum"
  361.       put x into it
  362.       subtract 1 from it
  363.       if  x>1 then put "?" into char it of field "Sum"
  364.       exit mouseUp
  365.     end if
  366.   end repeat
  367. end mouseUp
  368.  
  369.  
  370.  
  371. -- part 12 (button)
  372. -- low flags: 00
  373. -- high flags: 8003
  374. -- rect: left=414 top=281 right=313 bottom=468
  375. -- title width / last selected line: 0
  376. -- icon id / first selected line: 0 / 0
  377. -- text alignment: 1
  378. -- font id: 0
  379. -- text size: 12
  380. -- style flags: 0
  381. -- line height: 16
  382. -- part name: Enter
  383. ----- HyperTalk script -----
  384. on mouseUp
  385.   global answer
  386.   if field "SUM" < 1 then exit mouseUp
  387.   if field "Flag" > 0 then exit mouseUp
  388.   put field "Addend1" into answer
  389.   add field "Addend2" to answer
  390.   add 1 to field "Attempts"
  391.   if field "Sum" = answer then
  392.     add 1 to field "Correct"
  393.     get field "Correct"
  394.     divide it by field "Attempts"
  395.     multiply it by 100
  396.     put round(it) into field "Percent"
  397.     celebrate
  398.   else
  399.     get field "Correct"
  400.     divide it by field "Attempts"
  401.     multiply it by 100
  402.     put round(it) into field "Percent"
  403.     nag
  404.   end if
  405. end mouseUp
  406.  
  407. on celebrate
  408.   put "Correct" into line 1 of field "Comment"
  409.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  410.   hide button "Smiley"
  411.   put "1" into field "Flag"
  412.   if first word of bkgnd field "Options" = "Y" then
  413.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  414.   end if
  415. end celebrate
  416.  
  417. on nag
  418.   global answer
  419.   put "WRONG!" into line 1 of field "Comment"
  420.   put "The answer is "& answer & "." into line 3 of field "Comment"
  421.   hide button "Frowney"
  422.   put "2" into field "Flag"
  423.   if first word of bkgnd field "Options" = "Y" then
  424.     play "boing" tempo 200 "gq c e a"
  425.   end if
  426. end nag
  427.  
  428.  
  429.  
  430. -- part 13 (button)
  431. -- low flags: 00
  432. -- high flags: 8003
  433. -- rect: left=3 top=306 right=338 bottom=67
  434. -- title width / last selected line: 0
  435. -- icon id / first selected line: 0 / 0
  436. -- text alignment: 1
  437. -- font id: 0
  438. -- text size: 12
  439. -- style flags: 0
  440. -- line height: 16
  441. -- part name: Quit
  442. ----- HyperTalk script -----
  443. on mouseUp
  444.   go to first card
  445. end mouseUp
  446.  
  447.  
  448.  
  449. -- part 14 (button)
  450. -- low flags: 00
  451. -- high flags: 0001
  452. -- rect: left=249 top=88 right=181 bottom=349
  453. -- title width / last selected line: 0
  454. -- icon id / first selected line: 0 / 0
  455. -- text alignment: 1
  456. -- font id: 0
  457. -- text size: 12
  458. -- style flags: 0
  459. -- line height: 16
  460. -- part name: Frowney
  461.  
  462.  
  463. -- part 15 (button)
  464. -- low flags: 00
  465. -- high flags: 0001
  466. -- rect: left=14 top=87 right=178 bottom=110
  467. -- title width / last selected line: 0
  468. -- icon id / first selected line: 0 / 0
  469. -- text alignment: 1
  470. -- font id: 0
  471. -- text size: 12
  472. -- style flags: 0
  473. -- line height: 16
  474. -- part name: Smiley
  475.  
  476.  
  477. -- part contents for background part 4
  478. ----- text -----
  479.   
  480.  
  481. -- part contents for background part 5
  482. ----- text -----
  483.   
  484.  
  485. -- part contents for background part 8
  486. ----- text -----
  487. 1
  488.  
  489. -- part contents for background part 1
  490. ----- text -----
  491. O
  492.  
  493. -- part contents for background part 2
  494. ----- text -----
  495. O
  496.  
  497. -- part contents for background part 3
  498. ----- text -----
  499. O
  500.  
  501. -- part contents for background part 9
  502. ----- text -----
  503. Y 5 4
  504.  
  505. -- part contents for background part 10
  506. ----- text -----
  507. Larry